/*
 * @Author: sbotlp
 * @Email: sbotlp@sina.com
 * @Date: 2019-06-29 17:28:42
 * @LastEditTime: 2019-06-30 10:30:00
 * @Description: http://www.sbotlp.com.cn
 */
import * as Actions from '../actions/Loading.actions';
import { StoreState } from '../stateTypes/Loading.type';
import * as Constants from '../constants/ConstantsTypes';
const initState = {
  open: false
}
export function Loading(state: StoreState = initState, action: Actions.LoadingConstants): StoreState {
  switch (action.type) {
    case Constants.OPEN_LOADING:
      return {
        ...state,
        open: action.body
      }
    case Constants.COLSE_LOADING:
      return {
        ...state,
        open: action.body
      }
    default :
    return state;
  }
}